﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using log4net;

namespace CommonLibrary.Common
{
    class MyLog
    {
        static ILog log;

        /// <summary>
        /// 日志类实例访问属性
        /// </summary>
        public static ILog myLog
        {
            get
            {
                if (log == null)
                {
                    //调用log4net创建日志
                    log = LogManager.GetLogger("TextLogger");
                    if (log == null)
                    {
                        throw new NullReferenceException("创建TextLogger失败");
                    }
                }
                return MyLog.log;
            }
        }
    }
}
